<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
	<title>CRM-deal-list</title>
	<meta charset="UTF-8">
	<%@ include file="../include/head.jsp" %>
</head>

<body class="crm">
	
<jsp:include page="../include/top.jsp">
	<jsp:param value="deal" name="tag"/>
</jsp:include>


<div class="container-fluid">
	<div class="row-fluid">
	
	<div class="span8">
	<div class="well screen">
		<div class="page-header header">
			
			<div class="right-links">
				
			</div>
			所有的机会
			<span>${fn:length(dealList) }个机会，价值 ￥${money }</span>

		</div>
		<div class="live_search_spinner" behavior="spinner" id="parties_loading">
		  <div class="liner">
		    <h3>处理中...</h3>
		    <img src="${basePath }/img/indicator.gif" alt="mecrm">
		  </div>
		</div>
		<div class="main" id="main">


		<table class="table crm-table" id="chances">
		<tbody>
			<c:forEach items="${dealList }" var="deal">
			<tr>
				<td>
					<h4>
						<a href="${basePath }/deal/show?id=${deal.id}">${deal.title }</a>
					</h4>
						来自<a href="https://1339135738.workxp.info/people/485191">${deal.user.username }</a> 
						<div>${deal.content }</div>
					<div>
						<span style="background:#${deal.dealtype.color};" class="label">${deal.dealtype.type }</span>
						<c:if test="${deal.money == '0' }" >
							没有设置金额
						</c:if>
						<c:if test="${deal.money != '0' }">
							￥${deal.money }
						</c:if>
					</div>
				</td>
				<td class="actions" style="width:60px">
					<c:if test="${deal.state == 'pending' }">
						<span class="label label-pending">跟踪</span>
					</c:if>
					<c:if test="${deal.state == 'won' }">
						<span class="label label-success">成功</span>
					</c:if>
					<c:if test="${deal.state == 'lost' }">
						<span class="label label-important">失败</span>
					</c:if>
				</td>
			</tr>
			</c:forEach>
		</tbody>
		</table>
		

		</div>
	</div>
	</div>
	
	<div class="span4 sidebar">
		<div class="well">
			<a href="${basePath }/deal/new">创建机会</a>
		</div>
	
		<div class="well">
			<div class="title">
				过滤条件 ...
			</div>
			<div class="control-group select optional">
				<label class="select optional control-label">状态</label>
				<div class="controls">
					<select id="state" name="state" onchange="">
						<option value="">所有状态</option>
						<option value="pending">跟踪</option>
						<option value="won">成功</option>
						<option value="lost">失败</option>
					</select>
				</div>
			</div>
			<div class="control-group select optional">
				<label class="select optional control-label">分类</label>
				<div class="controls">
					<select id="category_id" name="category_id" onchange="">
					<option value="">所有分类</option>
					<option value="25294">免费</option>
					<option value="25295">付费</option>
					<option value="25375">爱人挖人</option>
					<option value="25376">的身份而粉色</option>
					<option value="none">--- 无 ---</option></select>
				</div>
			</div>
				<div class="control-group select optional">
					<label class="select optional control-label">负责人</label>
					<div class="controls">
						<select id="assigned_user_id" name="assigned_user_id" onchange="">
						<option value="任何人">任何人</option>
							<option value="none">--- 无 ---</option>
							<optgroup label="同事">
								<option value="u-5887">我</option>
								<option value="u-5888">shy935397008</option>
							</optgroup>
						</select>
					</div>
				</div>
			<div class="control-group select optional">
				<label class="select optional control-label">时间</label>
				<div class="controls">
					<select id="time" name="time" onchange="">
						<option value="">所有时间</option>
						<option value="7">最近一周</option>
						<option value="30">最近一个月</option>
						<option value="90">最近三个月</option>
						<option value="6m">最近六个月</option>
						<option value="year">今年</option>
						<option value="lyear">去年</option>
					</select>
				</div>
			</div>
		</div>

	</div>
</div>
</div>
	


</body></html>
